Xbasic

Class Attribute Keywords

Description

Alpha Five Version 7 honors only the static keyword. Eventually, Alpha Anywhere will eventually honor others keywords, such as private. A good way to describe the static attribute is to look at the documentation for Xbasic methods.

Take the file class for example.

h = file.open()

Take the file class for example. h = file.open() is calling a static method on the file class. It is not a method on an instantiated object. On the other hand h.close() is documented as <file>.close(). The <> notation is used to indicate that <file>is an object instance. The .close() method is not a static method because it operates on an object instance. (i.e. the object exists). The .open() method is a static method because it does not require that the object instance exists; it causes the object to come into existence.

A static method does not have to cause an object to come into existence. file.drives_get() is an example of a static method that does not instantiate an object. It does not require a file instance to do its job. It could just as easily have been called files_get_drive_list(). Calling it file.drives_get() in a naming convention to organize the function into a logical "namespace".